﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BookManage.Model
{
    /// <summary>
    /// 实体类Book
    /// </summary>
    public class Book
    {
        public Book() { }
        #region 公有属性
        public int bkID { get; set; }
        public string bkCode { get; set; }
        public string bkName { get; set; }
        public string bkAuthor { get; set; }
        public string bkPress { get; set; }
        public DateTime bkDatePress { get; set; }
        public string bkISBN { get; set; }
        public string bkCatalog { get; set; }
        public string bkLanguage { get; set; }
        public int bkPages { get; set; }
        public float bkPrice { get; set; }
        public DateTime bkDateIn { get; set; }
        public int bkNum { get; set; }
        public string bkBrief { get; set; }
        public Byte[] bkCover { get; set; }
        public string bkStatus { get; set; }
        #endregion
        public static string ColumnTitle(string columnName)
        {
            string[,] ColumnsTitle =
            {
                {"bkID","书号"},{"bkCode","图书编号"}, {"bkName","书名"}, {"bkAuthor","图书作者"},
                {"bkPress","出版社" }, {"bkDatePress","出版日期"}, {"bkISBN","ISBN号"}, {"bkCatalog","分类号"},
                {"bkLanguage","语言"}, {"bkPages","页数"}, {"bkPrice","价格"},{"bkDateIn","借书日期" },
                {"bkNum","数量" }, {"bkBrief","简介" }, {"bkCover","照片" }, {"bkStatus","状态" }
            };
            for (int i = 0; i < ColumnsTitle.Length / 2; i++)
            {
                if (columnName == ColumnsTitle[i, 0])
                    return ColumnsTitle[i, 1];
            }
            return columnName;
        }
    }
}
